ReaderManager

interface ReaderManager

Tracks changes to the set of available readers and their state; provides pairing and removal capabilities for card readers.

Types

Link copied to clipboard
object Companion

Constants for the ReaderManager.

Properties

Link copied to clipboard

Returns true if a Reader pairing is in progress, false otherwise.

Functions

Link copied to clipboard
abstract fun blink(reader: ReaderInfo)

Flashes LEDs on this reader to assist in identifying it.

Link copied to clipboard
abstract fun forget(reader: ReaderInfo)

Disconnects from the given ReaderInfo and "forgets" about it for future execution, returning it to a state before the reader was paired.

Link copied to clipboard
abstract fun getReader(id: String): ReaderInfo?

Gets a specific ReaderInfo by its id. Returns null if no such reader is found.

Link copied to clipboard
abstract fun getReaders(): List<ReaderInfo>

Gets a snapshot of the current state of all known readers. The returned objects will not reflect changes to the readers' state after this method is called.

Link copied to clipboard

Begins scanning for a new Bluetooth reader. The scan will terminate after a timeout, or after one new reader is identified, whether that reader is paired successfully or not.

Link copied to clipboard

Registers a callback to be called when a reader changes state. The supplied Callback will be called on the application UI thread at various perhaps-interesting moments, including when readers are discovered or lost, when cards are inserted or removed, etc.